home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / revolveToolScript.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.6 KB  |  126 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // Alias|Wavefront Script File
  19. // MODIFY THIS AT YOUR OWN RISK
  20. //
  21. // Creation Date:  14 January 1999
  22. // Author:         sw
  23. //
  24. //
  25. //  Procedure Name:
  26. //      revolveToolScript
  27. //
  28. //  Description:
  29. //    create wrapper around the revolve command
  30. //
  31. //  Input Arguments:
  32. //        0 ==> do the command.
  33. //        1 ==> show the tool/action option box
  34. //        2 ==> return the command
  35. //        3 ==> show tool/action option box
  36. //        4 ==> enter the tool
  37. //
  38. //  Return Value:
  39. //      None.
  40. //
  41.  
  42. global proc revolveToolSetup( int $forceFactorySettings, string $goToTool )
  43. {
  44.     global int $gStartWithAutoComplete;
  45.     if( $forceFactorySettings || !`optionVar -ex revolveEuc` ) {
  46.         optionVar -iv revolveEuc 0;
  47.     }
  48.     if( $forceFactorySettings || !`optionVar -ex revolveLac` ) {
  49.         optionVar -iv revolveLac $gStartWithAutoComplete;
  50.     }
  51.     if( "" != $goToTool ) {
  52.         scriptCtx -e -euc `optionVar -q revolveEuc` $goToTool;
  53.         scriptCtx -e -lac `optionVar -q revolveLac` $goToTool;
  54.     }
  55. }
  56.  
  57. global proc revolveValues ( string $toolName ) 
  58. {
  59.     performRevolve 3 $toolName;
  60.     scriptCtxCommonValues( $toolName );
  61. }
  62.  
  63. global proc revolveProperties()
  64. {
  65.     scriptCtxCommonProperties;
  66. }
  67.  
  68. proc createRevolveContext( string $tool )
  69. {
  70.     if( ! `scriptCtx -exists $tool` ) {
  71.         revolveToolSetup( 0, "" );
  72.         scriptCtx -i1 "revolve.xpm"
  73.           -title "Revolve Tool"
  74.           -bcn "revolve"
  75.  
  76.           -exitUponCompletion `optionVar -q revolveEuc`
  77.           -totalSelectionSets 1
  78.           -expandSelectionList true
  79.           -fcs ("revolveToolScript 0")
  80.  
  81.           -setNoSelectionPrompt ("Select a NURBS curves or curves " +
  82.                                  "on surface, surface isoparms, " +
  83.                                  "trim edges or a polygon edges to revolve.")
  84.           -setSelectionPrompt ("Select additional NURBS curves or curves " +
  85.                                "on surface, surface isoparms, " +
  86.                                "trim edges or a polygon edges or " +
  87.                                "press ENTER to compute revolve.")
  88.           -setDoneSelectionPrompt ("Press ENTER to compute revolve.")
  89.  
  90.           -setAutoToggleSelection true
  91.           -setAutoComplete `optionVar -q revolveLac`
  92.           -setAllowExcessCount true
  93.           -showManipulators true
  94.  
  95.           -setSelectionCount 0
  96.           -nurbsCurve true
  97.           -isoparm true
  98.           -curveOnSurface true
  99.           -surfaceEdge true
  100.           -polymeshEdge true
  101.         $tool;
  102.     }
  103. }
  104.  
  105. global proc string revolveToolScript( int $setToTool )
  106. //
  107. //    Description :
  108. //        0 ==> do the command.
  109. //        1 ==> show the action option box
  110. //        2 ==> return the command
  111. //        3 ==> show tool/action option box
  112. //        4 ==> enter the tool/do the command
  113. {
  114.     string $tool = "";
  115.     if( $setToTool > 2 ) {
  116.         if( !`optionVar -q modelWithToolRevolve` ) {
  117.             $setToTool = 4 - $setToTool;
  118.         }
  119.         else {
  120.             $tool = "revolveContext";
  121.             createRevolveContext $tool;
  122.         }
  123.     }
  124.     return scriptToolScript( "performRevolve", $setToTool, $tool );
  125. }
  126.